<!DOCTYPE html>
<html>
<head>
    <title>erp订单信息表</title>
    <#include "/header.html">
</head>
<link rel="stylesheet" href="${request.contextPath}/statics/plugins/oss/style.css">
<script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/js/plupload.full.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/ziyun_library.js"></script>

<style>
    #jqGrid tr td{
        vertical-align: middle;
    }
    a:link,a:visited{
        text-decoration:none;
    }
    .el-row {
        margin-bottom: 20px;
    &:last-child {
         margin-bottom: 0;
     }
    }
</style>
<body>
<div id="rrapp" v-cloak v-loading="allotLoading" element-loading-text="正在查找中...">
    <!-- 列表 -->
    <div v-show="showList">
        <!-- 查询 start -->
        <div class="grid-btn">
            <form class="form-inline" role="form">
                <a class="btn btn-default btn-sm" @click="reset"><i class="fa fa-refresh"></i></a>

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model.trim="q.orderNo" @keyup.enter="query" placeholder="订单号">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model.trim="q.memberName" @keyup.enter="query" placeholder="会员名">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.productionStatus" @keyup.enter="query">
                        <option value="">订单状态</option>
                        <option v-for="item in e.productionStatusEnum" v-if="item.id != 7" :value="item.id">{{item.describe}}</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input class="form-control input-sm" v-model="q.beginCreatetime" style="width: 120px;" @keyup.enter="query" @click = "checkBeginDate" placeholder="开始时间"/>
                    至
                    <input class="form-control input-sm" v-model="q.endCreatetime" style="width: 120px;"@keyup.enter="query" @click = "checkEndDate" placeholder="结束时间"/>
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.orderTag" @keyup.enter="query">
                        <option value="">标记</option>
                        <option value="0">未标记</option>
                        <option value="1">红旗</option>
                        <option value="2">蓝旗</option>
                        <option value="3">绿旗</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;

                <a class="btn btn-default btn-sm"  @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
            </form>
        </div>
        <!-- 查询 end -->
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>
    <!-- 详情页 -->
    <div v-show="showOrder">
        <!-- 操作 start -->
        <div class="panel-default" style="display: block;margin-bottom: 10px;" align="center">
            <!-- 审核 -->
            <div style="padding: 5px 0;" class="container">
                <div class="row">
                    <div class="col-md-4 col-md-offset-4">
                        <el-button size="small" class="pull-left" style="width: 100px;" @click="reload">返回</el-button>
                        <template v-if="erpOrderProductionList.length == 0" >
                            <el-button type="danger" size="small" style="width: 100px;" plain disabled>初始化</el-button>
                            <el-button type="primary" size="small" class="pull-right" style="width: 100px;" @click="orderAllot">订单分配</el-button>
                        </template>
                        <template v-else>
                            <el-button type="danger" size="small" style="width: 100px;" @click="orderInit">初始化</el-button>
                            <el-button type="primary" size="small" class="pull-right" style="width: 100px;" plain disabled>订单分配</el-button>
                        </template>

                    </div>
                </div>
            </div>
        </div>
        <!-- 操作 end -->

        <!-- 订单信息 start -->
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>订单编号：&nbsp;&nbsp;{{orderInfo.orderId}}</span>
                </div>
                <div class="text item">
                    <div class="row" style="line-height:30px;font-size: 12px;">
                        <div class="col-md-3">
                            <div class="row">
                                <div class="col-md-8 text-right">商品总额 ：</div>
                                <div class="col-md-4">{{orderInfo.totalAmount}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">运费 ：</div>
                                <div class="col-md-4">{{orderInfo.costFreight}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">支付金额 ：</div>
                                <div class="col-md-4">{{orderInfo.payed}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">支付方式 ：</div>
                                <div class="col-md-4">{{paymentType}}</div>
                            </div>

                        </div>
                        <div class="col-md-2">
                            <div class="row">
                                <div class="col-md-8 text-right">商品促销优惠 ：</div>
                                <div class="col-md-4">{{orderInfo.pmtGoods}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">优惠卷优惠 ：</div>
                                <div class="col-md-4">{{orderInfo.pmtOrder}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-8 text-right">随机立减 ：</div>
                                <div class="col-md-4">{{orderInfo.pmtRandom}}</div>
                            </div>
                        </div>
                        <div class="col-md-2">
                            <div class="row" style="line-height: 45px">
                                <div class="col-md-6 text-right">客服 ：</div>
                                <div class="col-md-6">
                                    <el-select v-model="erpOrder.csId" filterable placeholder="请选择" size="mini">
                                        <el-option v-for="item in csIdList" :key="item.userId + ''" :label="item.username" :value="item.userId + ''" :disabled="item.disabled"></el-option>
                                    </el-select>
                                </div>
                            </div>
                            <div class="row" style="line-height: 45px">
                                <div class="col-md-6 text-right">跟单员 ：</div>
                                <div class="col-md-6">
                                    <el-select v-model="erpOrder.pmcId" filterable placeholder="请选择" size="mini">
                                        <el-option v-for="item in pmcIdList" :key="item.userId + ''" :label="item.username" :value="item.userId + ''" :disabled="item.disabled"></el-option>
                                        </el-option>
                                    </el-select>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-5">
                            <div class="row">
                                <div class="col-md-3 text-right">审核人 ：</div>
                                <div class="col-md-4">{{erpOrder.auditNameVal}}</div>
                            </div>
                            <div class="row">
                                <div class="col-md-3 text-right">客户留言 ：</div>
                                <div class="col-md-9">
                                    {{erpOrder.memo}}
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-3 text-right">客服备注 ：</div>
                                <div class="col-md-9">
                                    <div class="box-body" style="line-height: 10px;margin-top: 10px;">
                                        <ul class="list-unstyled"  v-for="(remark, index) in remarkList">
                                            <li>
                                                <p style = "line-height:20px">
                                                    {{remark.orCreateTime}} {{remark.orCreateNameVal}}： {{remark.orRemarks}}
                                                </p>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </el-card>
        </el-row>
        <!-- 订单信息 end -->

        <!-- 支付信息 start -->
        <!--<el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>支付信息</span>
                </div>
                <div class="text item">
                    <el-table border stripe ref="multipleTable" :data="userPaymentList"
                              tooltip-effect="dark" size="mini">
                        <el-table-column prop="paymentId" label="支付单号" ></el-table-column>
                        <el-table-column prop="payName" label="支付类型"></el-table-column>
                        <el-table-column prop="money" label="支付金额"></el-table-column>
                        <el-table-column prop="tpayed" label="支付时间"></el-table-column>
                    </el-table>
                </div>
            </el-card>
        </el-row>-->
        <!-- 支付信息 end -->

        <!-- 商品信息 start -->
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>商品信息</span>
                </div>
                <div class="text item">
                    <el-table border stripe ref="multipleTable" :data="erpOrderItemEntityList"
                              tooltip-effect="dark" size="mini">
                        <el-table-column prop="originalItemId" label="商品ID" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="goodsId" label="SPU" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="name" label="商品名称" show-overflow-tooltip align='center' header-align="center"></el-table-column>
                        <el-table-column prop="addon" label="规格/尺寸/材质/工艺" v-if="orderInfo.promotionType == 'procurement'" min-width="200px" header-align="center"></el-table-column>
                        <el-table-column prop="addon" label="规格/尺寸/材质/工艺" v-if="orderInfo.promotionType != 'procurement'" :formatter="formatAddon" min-width="200px" header-align="center"></el-table-column>
                        <el-table-column prop="addcartBuyType" label="类型" width="80" align='center' header-align="center">
                            <template  slot-scope="scope">
                                <template v-if="scope.row.addcartBuyType == item.value" v-for="item in e.goodsTypeEnum">
                                    {{item.describe}}
                                </template>
                            </template>
                        </el-table-column>
                        <el-table-column label="详情" width="80" align='center' header-align="center">
                            <template  slot-scope="scope">
                                <el-button type="text" size="small" @click="showItemDetail(scope.row)" :disabled="(scope.row.addcartBuyType != 'print' && scope.row.addcartBuyType != 'fast') || orderInfo.promotionType == 'procurement'">查看</el-button>
                            </template>
                        </el-table-column>
                        <el-table-column prop="nums" label="数量" :formatter="formatNum" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column label="款式" width="80" align='center' header-align="center">
                            <template slot-scope="scope">
                                <span v-if="(scope.row.addcartBuyType == 'print' || scope.row.addcartBuyType == 'fast') && orderInfo.promotionType != 'procurement'">{{scope.row.nums}}</span>
                                <span v-else></span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="unit" label="单位" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="amount" label="总额" width="80" align='center' header-align="center"></el-table-column>
                        <el-table-column label="源文件" width="160" align='center' header-align="center">
                            <template slot-scope="scope">
                                <el-button size="mini" type="text" @click="itemFile.itemFileType = 'source'" :id="'upload_source'+ scope.$index" icon="el-icon-upload2">上传</el-button>
                                <el-button size="mini" type="text" v-show="scope.row.accessoryCount>0" @click="itemSourcePicsShow(scope.$index)" icon="el-icon-download">下载</el-button>
                            </template>
                        </el-table-column>
                        <el-table-column label="发货图片" width="160" align='center' header-align="center">
                            <template slot-scope="scope">
                                <el-button size="mini" type="text" @click="itemFile.itemFileType = 'send'" :id="'upload_send'+ scope.$index" icon="el-icon-upload2">上传</el-button>
                                <el-button size="mini" type="text" v-show="scope.row.sendPics!=null&&scope.row.sendPics!=''" @click="itemSendPicsShow(scope.$index)" icon="el-icon-download">下载</el-button>
                            </template>
                        </el-table-column>
                        <el-table-column prop="allotStatus" label="分配状态" width="80" align='center' header-align="center">
                            <template slot-scope="scope">
                                {{scope.row.status == 1 ? '未分配' : '已分配'}}
                            </template>
                        </el-table-column>
                        <el-table-column label="操作" align='center' header-align="center" width="200">
                            <template slot-scope="scope">
                                <template v-if="scope.row.status == 1">
                                    <template v-if="scope.row.addcartBuyType == 'print'">
                                        <el-button  @click="craftsAllot(scope.row)" type="text" size="small">工序分配</el-button>
                                    </template>
                                    <el-button @click="itemAllot(scope.row)" type="text" size="small">商品分配</el-button>
                                    <el-button @click="designItemAllot(scope.row)" type="text" size="small">设计商品分配</el-button>
                                    <el-button @click="yangluoSend(scope.row)" type="text" size="small">阳逻发货</el-button>
                                    <el-button @click="suppFormShow(scope.row)" type="text" size="small">添加外协</el-button>
                                </template>
                                <template v-else>
                                    <!-- 非订单分配 -->
                                    <template v-if="!scope.row.orderAllot">
                                        <!-- 工序分配 -->
                                        <el-button v-if="scope.row.allotType == 'procedure'" @click="craftsAllot(scope.row)" type="text" size="small">工序分配</el-button>
                                        <!-- 设计商品分配取消、录入物流成本 -->
                                        <el-button v-if="scope.row.selectCount == 0" @click="designItemReset(scope.row)" type="text" size="small">取消分配（设计商品）</el-button>
                                        <el-button v-if="scope.row.selectCount == 0" @click="send(scope.row.orderNo)" type="text" size="small">添加物流（设计商品）</el-button>
                                        <!-- 添加外协 -->
                                        <el-button v-if="scope.row.sellerCount == 0 && scope.row.suppCount > 0" @click="suppFormShow(scope.row)" type="text" size="small">添加外协</el-button>
                                    </template>
                                    <!-- 成本录入（针对于线上分配订单，只录入外协成本信息） -->
                                    <#if shiro.hasPermission("order:erporder:costsave")>
                                        <el-button v-if="scope.row.sellerCount > 0 || scope.row.orderAllot" @click="costFormShow(scope.row)" type="text" size="small">成本录入</el-button>
                                    </#if>
                                </template>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </el-card>
        </el-row>
        <!-- 商品信息 end -->

        <!-- 商品分配列表 start -->
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>商品分配列表</span>
                </div>
                <div class="text item">
                    <el-table border stripe ref="multipleTable" :data="erpOrderProductionList"
                              tooltip-effect="dark" size="mini">
                        <el-table-column type="index" label="序号" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="orderItemId" label="商品ID" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="erpItemName" label="商品名称" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="attributeName" label="工艺" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="producerName" label="供应商" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="cost" label="分配价格" align='center' header-align="center"></el-table-column>
                        <el-table-column prop="allotType" label="分配类型" align='center' header-align="center"></el-table-column>
                        <el-table-column label="详情" align='center' header-align="center">
                            <template  slot-scope="scope">
                                <el-button type="text" size="small" @click="showQuoteItemDetail(scope.row)" :disabled="(scope.row.addcartBuyType != 'print' && scope.row.addcartBuyType != 'fast') || scope.row.onlineCash != 1">查看</el-button>
                            </template>
                        </el-table-column>
                        <el-table-column prop="isOwn" label="是否自做" align='center' header-align="center">
                            <template slot-scope="scope">
                                {{scope.row.isOwn == 1 ? '是' : '否'}}
                            </template>
                        </el-table-column>
                        <el-table-column prop="csRemark" label="备注" header-align="center"></el-table-column>
                        <el-table-column prop="productionOrder" label="第三方单号" align='center' header-align="center"></el-table-column>
                        <el-table-column label="操作" align='center' header-align="center">
                            <template slot-scope="scope">
                                <el-button type="text" @click="delAllotItem(scope.row)" size="small">删除</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </el-card>
        </el-row>
        <!-- 商品分配列表 end -->
    </div>
    <!-- 物流发货 -->
    <div v-show="showLogi">
        <form class="form-group">
            <!-- 订单信息 start -->
            <div class="panel panel-default">
                <div class="panel-heading">
                    订单信息
                </div>
                <div class="panel-body">
                    <div class="row" style="line-height: 25px">
                        <div class="col-md-3 text-center">订单号：{{erpOrder == null ? '' : erpOrder.orderNo}}</div>
                        <div class="col-md-3 text-center">会员名：{{erpOrder == null ? '' : erpOrder.memberName}}</div>
                        <div class="col-md-3 text-center">订单金额：{{erpOrder == null ? '' : erpOrder.totalAmount}}</div>
                        <div class="col-md-3 text-center">送货方式：{{erpOrder == null ? '' : (erpOrder.sendType == true ? "自提" : "非自提") }}</div>
                    </div>

                </div>
            </div>
            <!-- 订单信息 end -->
            <!-- 发货信息 start -->
            <div class="panel panel-default">
                <div class="panel-heading">
                    发货信息
                </div>
                <div class="panel-body" style="line-height: 35px">
                    <div class="col-md-3" style="line-height: 45px">
                        <div class="row">
                            <div class="col-md-3 text-right"><span style="color: red">*&nbsp;</span>发货类型：</div>
                            <div class="col-md-9">
                                <el-radio-group v-model="erpLogisticsEntity.sendType" @change="sendTypeChange"
                                                size="mini">
                                    <el-radio :label="1" border>发票</el-radio>
                                    <el-radio :label="2" border>样品</el-radio>
                                    <el-radio :label="3" border>订单</el-radio>
                                </el-radio-group>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right"><span style="color: red">*&nbsp;</span>物流类型：</div>
                            <div class="col-md-9">
                                <el-radio-group v-model="erpLogisticsEntity.logiType" size="mini">
                                    <el-radio :label="1" border>呼叫快递</el-radio>
                                    <el-radio :label="2" border>添加物流</el-radio>
                                    <el-radio :label="3" border>自提</el-radio>
                                </el-radio-group>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right"><span style="color: red" v-if="erpLogisticsEntity.logiType === 3?false:true">*&nbsp;</span>物流方式：</div>
                            <div class="col-md-9">
                                <el-select v-model="erpLogisticsEntity.logisticsId" @change="logiTypeChange" filterable
                                           placeholder="请选择" size="mini">
                                    <el-option v-for="item in logisticsTypeList" :key="item.logisticsId"
                                               :label="item.logisticsName" :value="item.logisticsId"/>
                                </el-select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3" style="line-height: 45px">
                        <div class="row" v-show="showLogiNo">
                            <div class="col-md-3 text-right">配送单号：</div>
                            <div class="col-md-9">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.logiNo"
                                       placeholder="配送单号"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right">配送费用：</div>
                            <div class="col-md-9">
                                <input type="number" class="form-control input-sm" v-model="erpLogisticsEntity.logiCost"
                                       placeholder="配送费用"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right">配送备注：</div>
                            <div class="col-md-9 text-right">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.logiRemark"
                                       placeholder="配送备注"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-4 text-right"><span style="color: red">*&nbsp;</span>收货人：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toPeople"
                                       placeholder="收货人"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right"><span style="color: red">*&nbsp;</span>收货联系方式：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toPhone"
                                       value="{{erpOrder.shipName}}" placeholder="收货联系方式"/>
                            </div>
                        </div>
                        <!--<div class="row">
                            <div class="col-md-4 text-right"><span style="color: red">*&nbsp;</span>收货地区：</div>
                            <div class="col-md-8 ">
                                <el-cascader placeholder="试试搜索：武汉市" size="small" filterable
                                             style="width: 100%"
                                             :options="area"
                                             @change="handleItemChange">

                                </el-cascader>
                            </div>
                        </div>-->
                        <div class="row">
                            <div class="col-md-4 text-right">收货地区：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toArea"
                                       placeholder="收货地区"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">收货地址：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toAddress"
                                       placeholder="收货地址"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-5 text-right">发货人：</div>
                            ziyun
                        </div>
                        <div class="row">
                            <div class="col-md-5 text-right">联系方式：</div>
                            400-000-2519
                        </div>
                        <div class="row">
                            <div class="col-md-5 text-right">发货地址：</div>
                            江汉区常青三路17B9-13
                        </div>
                    </div>
                </div>
            </div>
            <!-- 发货信息 end -->
            <!-- 发货明细 start -->
            <div class="panel panel-default" v-show="showSendDetail">
                <div class="panel-heading">
                    发货明细
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <el-table border stripe ref="multipleTable" :data="orderItemList"
                                  @selection-change="orderItemSelectionChange"
                                  tooltip-effect="dark" size="mini">
                            <el-table-column type="selection" width="55"></el-table-column>
                            <el-table-column prop="itemId" label="商品ID" width="100"></el-table-column>
                            <el-table-column prop="name" label="商品名称" show-overflow-tooltip></el-table-column>
                            <el-table-column prop="addon" label="规格属性" show-overflow-tooltip></el-table-column>
                            <el-table-column prop="productId" label="商品编号" width="100"></el-table-column>
                            <el-table-column prop="unit" label="单位" width="60"></el-table-column>
                            <el-table-column prop="craftsNames" label="工艺" width="120"></el-table-column>
                            <el-table-column prop="nums" label="数量" width="100" fixed="right">
                                <template slot-scope="scope">
                                    <el-input type="number" v-model="scope.row.nums" size="small" min="0"
                                              :max="scope.row.nums" :value="scope.row.nums"></el-input>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
            <!-- 发货明细 end -->
            <div class="grid-btn text-center">
                <a class="btn btn-primary btn-sm" @click="saveLogistics">确认保存</a>
                <a class="btn btn-warning btn-sm" @click="reload">返回</a>
            </div>
        </form>
    </div>

    <!-- 订单初始化信息展示列表(分配工厂订单) -->
    <el-dialog title="原系统工厂分配信息" :visible.sync="relevanceListVisible" width= "40%" >
        <el-table :data="relevanceList" size="small">
            <el-table-column property="name" label="商品名称"></el-table-column>
            <el-table-column property="orderAllotNo" label="分配订单号"></el-table-column>
            <el-table-column property="productionStatusText" label="生产状态"></el-table-column>
            <el-table-column property="financeStatusText" label="财务审核状态"></el-table-column>
        </el-table>
    </el-dialog>

    <!-- 发货文件下载列表 -->
    <el-dialog title="文件下载" :visible.sync="itemSendFileTableVisible" width= "40%" >
        <el-table :data="itemFile.itemSendFiles" size="small">
            <el-table-column v-if="false" property="id" label="文件ID"></el-table-column>
            <el-table-column property="name" label="文件名"></el-table-column>
            <el-table-column property="size" label="文件大小"></el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-row>
                        <el-button type="text" @click="itemSendFileDownload(scope.row)" size="mini" icon="el-icon-download">下载</el-button>
                        <el-button type="text" @click="itemSendFileDelete(scope.row)" size="mini" icon="el-icon-delete">删除</el-button>
                    </el-row>
                </template>
            </el-table-column>
        </el-table>
    </el-dialog>

    <!-- 原文件下载列表 -->
    <el-dialog title="文件下载" :visible.sync="itemSourceFileTableVisible" width= "40%" >
        <el-table :data="itemFile.itemSourceFiles" size="small">
            <el-table-column v-if="false" property="id" label="文件ID"></el-table-column>
            <el-table-column property="name" label="文件名"></el-table-column>
            <el-table-column property="size" label="文件大小"></el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-row>
                        <el-button type="text" @click="itemSourceFileDownload(scope.row)" size="mini" icon="el-icon-download">下载</el-button>
                        <el-button type="text" @click="itemSourceFileDelete(scope.row)" size="mini" icon="el-icon-delete">删除</el-button>
                    </el-row>
                </template>
            </el-table-column>
        </el-table>
    </el-dialog>

    <!-- 商品分配方式 start -->
    <el-dialog title="请选择分配方式" :visible.sync="itemAllotVisible" width= "20%" center="true">
        <template>
            <div align="center">
                <p>
                    <el-button @click="itemAllotType(1)" type="text">自营门店</el-button>
                </p>
                <p>
                    <el-button @click="itemAllotType(2)" type="text">第三方</el-button>
                </p>
            </div>
        </template>
    </el-dialog>
    <!-- 商品分配方式 end -->

    <!-- 添加标记 start -->
    <el-dialog title="标记添加" :visible.sync="orderTagVisible" width= "20%" center="true">
        <template>
            <div align="center">
                <input @click="addOrderTag(1)" type="button" style="width:50px; height:50px; border:0; background:url('${request.contextPath}/statics/img/imageselect/img/1.png') no-repeat center" />
                &nbsp;&nbsp;&nbsp;
                <input @click="addOrderTag(2)" type="button" style="width:50px; height:50px; border:0; background:url('${request.contextPath}/statics/img/imageselect/img/2.png') no-repeat center" />
                &nbsp;&nbsp;&nbsp;
                <input @click="addOrderTag(3)" type="button" style="width:50px; height:50px; border:0; background:url('${request.contextPath}/statics/img/imageselect/img/3.png') no-repeat center" />
            </div>
        </template>
        <div slot="footer" class="dialog-footer">
            <el-button size="small" type="primary" @click="addOrderTag(0)">清 除</el-button>
        </div>
    </el-dialog>
    <!-- 添加标记 end -->

    <!-- 添加外协 start -->
    <el-dialog title="添加工艺" :visible.sync="suppFormVisible" width= "30%" append-to-body>
        <el-form :model="suppForm" size="medium">
            <el-form-item label="工艺：" label-width="120px">
                <el-input v-model="suppForm.attributeName" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="费用：" label-width="120px">
                <el-input type="number" v-model="suppForm.cost" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="备注：" label-width="120px">
                <el-input v-model="suppForm.csRemark" auto-complete="off"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button size="small" @click="suppFormVisible = false">取 消</el-button>
            <el-button size="small" type="primary" @click="suppFormSave">确 定</el-button>
        </div>
    </el-dialog>
    <!-- 添加外协 end -->

    <!-- 外协商 start -->
    <el-dialog title="选择外协商" :visible.sync="supplierPageVisible" width= "30%">
        <el-row>
            <el-form :inline="true" class="demo-form-inline" size="mini">
                <el-form-item label="名称：">
                    <el-input v-model="supplierQuery.supplierName"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="querySupplierPageList">查询</el-button>
                </el-form-item>
            </el-form>
        </el-row>
        <el-row>
            <el-table :data="supplierPage.tableData" size="mini">
                <el-table-column  prop="supplierName" label="供应商"></el-table-column>
                <el-table-column label="操作" width="100px">
                    <template slot-scope="scope">
                        <el-button @click="suppFormCheck(scope.row)" type="text" size="mini">选择</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-row>
        <el-row>
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="1"
                    :page-size="supplierPage.pageSize"
                    small
                    layout="prev, pager, next"
                    :total="supplierPage.totalCount">
            </el-pagination>
        </el-row>
    </el-dialog>
    <!-- 外协商 end -->

</div>

<!-- 报价商品算价详情 -->
<#include "/modules/order/itemQuoteDetail.html">
<!-- 订单分配页面 -->
<#include "/modules/order/orderAllot.html">
<!-- 商品分配页面 -->
<#include "/modules/order/itemAllot.html">
<!-- 工序分配页面 -->
<#include "/modules/order/craftsAllot.html">
<script src="${request.contextPath}/statics/js/modules/order/erporder.js?_${.now?long}"></script>
</body>
</html>